home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 June: Technology Seed / ADC Seed CD - June 1999.toast / ColorSync / ColorSync 2.6 Mac SDK / Interfaces / CMApplication.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-04-12  |  49.0 KB  |  1,455 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        CMApplication.h
  3.  
  4.      Contains:    Color Matching Interfaces
  5.  
  6.      Version:    Technology:    ColorSync 2.6
  7.                  Release:    ColorSync 2.6 SDK for use with Universal Interfaces 3.1
  8.  
  9.      Copyright:    © 1992, 1994-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __CMAPPLICATION__
  18. #define __CMAPPLICATION__
  19.  
  20. #ifndef __MACTYPES__
  21. #include <MacTypes.h>
  22. #endif
  23. #ifndef __QUICKDRAW__
  24. #include <Quickdraw.h>
  25. #endif
  26. #ifndef __FILES__
  27. #include <Files.h>
  28. #endif
  29. #ifndef __PRINTING__
  30. #include <Printing.h>
  31. #endif
  32. #ifndef __CMICCPROFILE__
  33. #include <CMICCProfile.h>
  34. #endif
  35. #ifndef __DISPLAYS__
  36. #include <Displays.h>
  37. #endif
  38.  
  39.  
  40. #if TARGET_OS_WIN32
  41. #include <windows.h>
  42. #endif
  43.  
  44.  
  45.  
  46. #if PRAGMA_ONCE
  47. #pragma once
  48. #endif
  49.  
  50. #ifdef __cplusplus
  51. extern "C" {
  52. #endif
  53.  
  54. #if PRAGMA_IMPORT
  55. #pragma import on
  56. #endif
  57.  
  58. #if PRAGMA_STRUCT_ALIGN
  59.     #pragma options align=mac68k
  60. #elif PRAGMA_STRUCT_PACKPUSH
  61.     #pragma pack(push, 2)
  62. #elif PRAGMA_STRUCT_PACK
  63.     #pragma pack(2)
  64. #endif
  65.  
  66.  
  67. enum {
  68.     kDefaultCMMSignature        = FOUR_CHAR_CODE('appl')
  69. };
  70.  
  71. /* Macintosh 68K trap word */
  72.  
  73. enum {
  74.     cmTrap                        = 0xABEE
  75. };
  76.  
  77.  
  78. /* PicComment IDs */
  79.  
  80. enum {
  81.     cmBeginProfile                = 220,
  82.     cmEndProfile                = 221,
  83.     cmEnableMatching            = 222,
  84.     cmDisableMatching            = 223,
  85.     cmComment                    = 224
  86. };
  87.  
  88. /* PicComment selectors for cmComment */
  89.  
  90. enum {
  91.     cmBeginProfileSel            = 0,
  92.     cmContinueProfileSel        = 1,
  93.     cmEndProfileSel                = 2,
  94.     cmProfileIdentifierSel        = 3
  95. };
  96.  
  97.  
  98. /* Defines for version 1.0 CMProfileSearchRecord.fieldMask */
  99.  
  100. enum {
  101.     cmMatchCMMType                = 0x00000001,
  102.     cmMatchApplProfileVersion    = 0x00000002,
  103.     cmMatchDataType                = 0x00000004,
  104.     cmMatchDeviceType            = 0x00000008,
  105.     cmMatchDeviceManufacturer    = 0x00000010,
  106.     cmMatchDeviceModel            = 0x00000020,
  107.     cmMatchDeviceAttributes        = 0x00000040,
  108.     cmMatchFlags                = 0x00000080,
  109.     cmMatchOptions                = 0x00000100,
  110.     cmMatchWhite                = 0x00000200,
  111.     cmMatchBlack                = 0x00000400
  112. };
  113.  
  114. /* Defines for version 2.0 CMSearchRecord.searchMask */
  115.  
  116. enum {
  117.     cmMatchAnyProfile            = 0x00000000,
  118.     cmMatchProfileCMMType        = 0x00000001,
  119.     cmMatchProfileClass            = 0x00000002,
  120.     cmMatchDataColorSpace        = 0x00000004,
  121.     cmMatchProfileConnectionSpace = 0x00000008,
  122.     cmMatchManufacturer            = 0x00000010,
  123.     cmMatchModel                = 0x00000020,
  124.     cmMatchAttributes            = 0x00000040,
  125.     cmMatchProfileFlags            = 0x00000080
  126. };
  127.  
  128. /* Result codes */
  129.  
  130. enum {
  131.                                                                 /* General Errors */
  132.     cmProfileError                = -170,
  133.     cmMethodError                = -171,
  134.     cmMethodNotFound            = -175,                            /* CMM not present */
  135.     cmProfileNotFound            = -176,                            /* Responder error */
  136.     cmProfilesIdentical            = -177,                            /* Profiles the same */
  137.     cmCantConcatenateError        = -178,                            /* Profile can't be concatenated */
  138.     cmCantXYZ                    = -179,                            /* CMM cant handle XYZ space */
  139.     cmCantDeleteProfile            = -180,                            /* Responder error */
  140.     cmUnsupportedDataType        = -181,                            /* Responder error */
  141.     cmNoCurrentProfile            = -182,                            /* Responder error */
  142.                                                                 /* Profile Access Errors */
  143.     cmElementTagNotFound        = -4200,
  144.     cmIndexRangeErr                = -4201,                        /* Tag index out of range */
  145.     cmCantDeleteElement            = -4202,
  146.     cmFatalProfileErr            = -4203,
  147.     cmInvalidProfile            = -4204,                        /* A Profile must contain a 'cs1 ' tag to be valid */
  148.     cmInvalidProfileLocation    = -4205,                        /* Operation not supported for this profile location */
  149.     cmCantCopyModifiedV1Profile    = -4215,                        /* Illegal to copy version 1 profiles that have been modified */
  150.                                                                 /* Profile Search Errors */
  151.     cmInvalidSearch                = -4206,                        /* Bad Search Handle */
  152.     cmSearchError                = -4207,
  153.     cmErrIncompatibleProfile    = -4208,                        /* Other ColorSync Errors */
  154.     cmInvalidColorSpace            = -4209,                        /* Profile colorspace does not match bitmap type */
  155.     cmInvalidSrcMap                = -4210,                        /* Source pix/bit map was invalid */
  156.     cmInvalidDstMap                = -4211,                        /* Destination pix/bit map was invalid */
  157.     cmNoGDevicesError            = -4212,                        /* Begin/End Matching -- no gdevices available */
  158.     cmInvalidProfileComment        = -4213,                        /* Bad Profile comment during drawpicture */
  159.     cmRangeOverFlow                = -4214,                        /* Color conversion warning that some output color values over/underflowed and were clipped */
  160.     cmNamedColorNotFound        = -4216,                        /* NamedColor not found */
  161.     cmCantGamutCheckError        = -4217                            /* Gammut checking not supported by this ColorWorld */
  162. };
  163.  
  164. /* deviceType values for ColorSync 1.0 Device Profile access */
  165.  
  166. enum {
  167.     cmSystemDevice                = FOUR_CHAR_CODE('sys '),
  168.     cmGDevice                    = FOUR_CHAR_CODE('gdev')
  169. };
  170.  
  171. /* Commands for CMFlattenUPP(…) */
  172.  
  173. enum {
  174.     cmOpenReadSpool                = 1,
  175.     cmOpenWriteSpool            = 2,
  176.     cmReadSpool                    = 3,
  177.     cmWriteSpool                = 4,
  178.     cmCloseSpool                = 5
  179. };
  180.  
  181. /* Flags for PostScript-related functions */
  182.  
  183. enum {
  184.     cmPS7bit                    = 1,
  185.     cmPS8bit                    = 2
  186. };
  187.  
  188. /* Flags for profile embedding functions */
  189.  
  190. enum {
  191.     cmEmbedWholeProfile            = 0x00000000,
  192.     cmEmbedProfileIdentifier    = 0x00000001
  193. };
  194.  
  195. /* Commands for CMAccessUPP(…) */
  196.  
  197. enum {
  198.     cmOpenReadAccess            = 1,
  199.     cmOpenWriteAccess            = 2,
  200.     cmReadAccess                = 3,
  201.     cmWriteAccess                = 4,
  202.     cmCloseAccess                = 5,
  203.     cmCreateNewAccess            = 6,
  204.     cmAbortWriteAccess            = 7,
  205.     cmBeginAccess                = 8,
  206.     cmEndAccess                    = 9
  207. };
  208.  
  209.  
  210. /* Abstract data type for memory-based Profile */
  211. typedef struct OpaqueCMProfileRef*         CMProfileRef;
  212. /* Abstract data type for Profile search result */
  213. typedef struct OpaqueCMProfileSearchRef*  CMProfileSearchRef;
  214. /* Abstract data type for BeginMatching(…) reference */
  215. typedef struct OpaqueCMMatchRef*         CMMatchRef;
  216. /* Abstract data type for ColorWorld reference */
  217. typedef struct OpaqueCMWorldRef*         CMWorldRef;
  218. /* Caller-supplied flatten function */
  219. typedef CALLBACK_API( OSErr , CMFlattenProcPtr )(long command, long *size, void *data, void *refCon);
  220. /* Caller-supplied progress function for Bitmap & PixMap matching routines */
  221. typedef CALLBACK_API( Boolean , CMBitmapCallBackProcPtr )(long progress, void *refCon);
  222. /* Caller-supplied progress function for NCMMConcatInit & NCMMNewLinkProfile routines */
  223. typedef CALLBACK_API( Boolean , CMConcatCallBackProcPtr )(long progress, void *refCon);
  224. /* Caller-supplied filter function for Profile search */
  225. typedef CALLBACK_API( Boolean , CMProfileFilterProcPtr )(CMProfileRef prof, void *refCon);
  226. /* Caller-supplied function for profile access */
  227. typedef CALLBACK_API( OSErr , CMProfileAccessProcPtr )(long command, long offset, long *size, void *data, void *refCon);
  228. typedef STACK_UPP_TYPE(CMFlattenProcPtr)                         CMFlattenUPP;
  229. typedef STACK_UPP_TYPE(CMBitmapCallBackProcPtr)                 CMBitmapCallBackUPP;
  230. typedef STACK_UPP_TYPE(CMConcatCallBackProcPtr)                 CMConcatCallBackUPP;
  231. typedef STACK_UPP_TYPE(CMProfileFilterProcPtr)                     CMProfileFilterUPP;
  232. typedef STACK_UPP_TYPE(CMProfileAccessProcPtr)                     CMProfileAccessUPP;
  233. enum { uppCMFlattenProcInfo = 0x00003FE0 };                     /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  234. enum { uppCMBitmapCallBackProcInfo = 0x000003D0 };                 /* pascal 1_byte Func(4_bytes, 4_bytes) */
  235. enum { uppCMConcatCallBackProcInfo = 0x000003D0 };                 /* pascal 1_byte Func(4_bytes, 4_bytes) */
  236. enum { uppCMProfileFilterProcInfo = 0x000003D0 };                 /* pascal 1_byte Func(4_bytes, 4_bytes) */
  237. enum { uppCMProfileAccessProcInfo = 0x0000FFE0 };                 /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  238. #if MIXEDMODE_CALLS_ARE_FUNCTIONS
  239. EXTERN_API(CMFlattenUPP)
  240. NewCMFlattenProc               (CMFlattenProcPtr        userRoutine);
  241. EXTERN_API(CMBitmapCallBackUPP)
  242. NewCMBitmapCallBackProc           (CMBitmapCallBackProcPtr    userRoutine);
  243. EXTERN_API(CMConcatCallBackUPP)
  244. NewCMConcatCallBackProc           (CMConcatCallBackProcPtr    userRoutine);
  245. EXTERN_API(CMProfileFilterUPP)
  246. NewCMProfileFilterProc           (CMProfileFilterProcPtr    userRoutine);
  247. EXTERN_API(CMProfileAccessUPP)
  248. NewCMProfileAccessProc           (CMProfileAccessProcPtr    userRoutine);
  249. EXTERN_API(OSErr)
  250. CallCMFlattenProc               (CMFlattenUPP            userRoutine,
  251.                                 long                    command,
  252.                                 long *                    size,
  253.                                 void *                    data,
  254.                                 void *                    refCon);
  255. EXTERN_API(Boolean)
  256. CallCMBitmapCallBackProc       (CMBitmapCallBackUPP        userRoutine,
  257.                                 long                    progress,
  258.                                 void *                    refCon);
  259. EXTERN_API(Boolean)
  260. CallCMConcatCallBackProc       (CMConcatCallBackUPP        userRoutine,
  261.                                 long                    progress,
  262.                                 void *                    refCon);
  263. EXTERN_API(Boolean)
  264. CallCMProfileFilterProc           (CMProfileFilterUPP        userRoutine,
  265.                                 CMProfileRef            prof,
  266.                                 void *                    refCon);
  267. EXTERN_API(OSErr)
  268. CallCMProfileAccessProc           (CMProfileAccessUPP        userRoutine,
  269.                                 long                    command,
  270.                                 long                    offset,
  271.                                 long *                    size,
  272.                                 void *                    data,
  273.                                 void *                    refCon);
  274. #else
  275. #define NewCMFlattenProc(userRoutine)                             (CMFlattenUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMFlattenProcInfo, GetCurrentArchitecture())
  276. #define NewCMBitmapCallBackProc(userRoutine)                     (CMBitmapCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMBitmapCallBackProcInfo, GetCurrentArchitecture())
  277. #define NewCMConcatCallBackProc(userRoutine)                     (CMConcatCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMConcatCallBackProcInfo, GetCurrentArchitecture())
  278. #define NewCMProfileFilterProc(userRoutine)                     (CMProfileFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMProfileFilterProcInfo, GetCurrentArchitecture())
  279. #define NewCMProfileAccessProc(userRoutine)                     (CMProfileAccessUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMProfileAccessProcInfo, GetCurrentArchitecture())
  280. #define CallCMFlattenProc(userRoutine, command, size, data, refCon)  CALL_FOUR_PARAMETER_UPP((userRoutine), uppCMFlattenProcInfo, (command), (size), (data), (refCon))
  281. #define CallCMBitmapCallBackProc(userRoutine, progress, refCon)  CALL_TWO_PARAMETER_UPP((userRoutine), uppCMBitmapCallBackProcInfo, (progress), (refCon))
  282. #define CallCMConcatCallBackProc(userRoutine, progress, refCon)  CALL_TWO_PARAMETER_UPP((userRoutine), uppCMConcatCallBackProcInfo, (progress), (refCon))
  283. #define CallCMProfileFilterProc(userRoutine, prof, refCon)         CALL_TWO_PARAMETER_UPP((userRoutine), uppCMProfileFilterProcInfo, (prof), (refCon))
  284. #define CallCMProfileAccessProc(userRoutine, command, offset, size, data, refCon)  CALL_FIVE_PARAMETER_UPP((userRoutine), uppCMProfileAccessProcInfo, (command), (offset), (size), (data), (refCon))
  285. #endif
  286. typedef long                             CMError;
  287. /* For 1.0 and 2.0 profile header variants */
  288. /* CMAppleProfileHeader */
  289.  
  290. union CMAppleProfileHeader {
  291.     CMHeader                         cm1;
  292.     CM2Header                         cm2;
  293. };
  294. typedef union CMAppleProfileHeader        CMAppleProfileHeader;
  295. /* Param for CWConcatColorWorld(…) */
  296.  
  297. struct CMConcatProfileSet {
  298.     UInt16                             keyIndex;                    /* Zero-based */
  299.     UInt16                             count;                        /* Min 1 */
  300.     CMProfileRef                     profileSet[1];                /* Variable. Ordered from Source -> Dest */
  301. };
  302. typedef struct CMConcatProfileSet        CMConcatProfileSet;
  303.  
  304. /* NCMConcatProfileSpec Tags */
  305.  
  306. enum {
  307.     kNoTransform                = 0,                            /* Not used */
  308.     kUseAtoB                    = 1,                            /* Use 'A2B*' tag from this profile or equivalent */
  309.     kUseBtoA                    = 2,                            /* Use 'B2A*' tag from this profile or equivalent */
  310.     kUseBtoB                    = 3,                            /* Use 'pre*' tag from this profile or equivalent */
  311.                                                                 /* For typical device profiles the following synonyms may be useful */
  312.     kDeviceToPCS                = kUseAtoB,                        /* Device Dependent to Device Independent */
  313.     kPCSToDevice                = kUseBtoA,                        /* Device Independent to Device Dependent */
  314.     kPCSToPCS                    = kUseBtoB,                        /* Independent, through device's gamut */
  315.     kUseProfileIntent            = (long)0xFFFFFFFF                /* For renderingIntent in NCMConcatProfileSpec    */
  316. };
  317.  
  318. /* NCMConcatProfileSpec */
  319.  
  320. struct NCMConcatProfileSpec {
  321.     UInt32                             renderingIntent;            /* renderingIntent override        */
  322.     UInt32                             transformTag;                /* transformTag, defined above    */
  323.     CMProfileRef                     profile;                    /* profile */
  324. };
  325. typedef struct NCMConcatProfileSpec        NCMConcatProfileSpec;
  326. /* NCMConcatProfileSet */
  327.  
  328. struct NCMConcatProfileSet {
  329.     OSType                             cmm;                        /* e.g. 'KCMS', 'appl', ...  uniquely ids the cmm, or 0000 */
  330.     UInt32                             flags;                        /* specify quality, lookup only, no gamut checking ... */
  331.     UInt32                             flagsMask;                    /* which bits of 'flags' to use to override profile */
  332.     UInt32                             profileCount;                /* how many ProfileSpecs in the following set */
  333.     NCMConcatProfileSpec             profileSpecs[1];            /* Variable. Ordered from Source -> Dest */
  334. };
  335. typedef struct NCMConcatProfileSet        NCMConcatProfileSet;
  336. /* ColorSync color data types */
  337.  
  338. struct CMRGBColor {
  339.     UInt16                             red;                        /* 0..65535 */
  340.     UInt16                             green;
  341.     UInt16                             blue;
  342. };
  343. typedef struct CMRGBColor                CMRGBColor;
  344.  
  345. struct CMCMYKColor {
  346.     UInt16                             cyan;                        /* 0..65535 */
  347.     UInt16                             magenta;
  348.     UInt16                             yellow;
  349.     UInt16                             black;
  350. };
  351. typedef struct CMCMYKColor                CMCMYKColor;
  352.  
  353. struct CMCMYColor {
  354.     UInt16                             cyan;                        /* 0..65535 */
  355.     UInt16                             magenta;
  356.     UInt16                             yellow;
  357. };
  358. typedef struct CMCMYColor                CMCMYColor;
  359.  
  360. struct CMHLSColor {
  361.     UInt16                             hue;                        /* 0..65535. Fraction of circle. Red at 0 */
  362.     UInt16                             lightness;                    /* 0..65535 */
  363.     UInt16                             saturation;                    /* 0..65535 */
  364. };
  365. typedef struct CMHLSColor                CMHLSColor;
  366.  
  367. struct CMHSVColor {
  368.     UInt16                             hue;                        /* 0..65535. Fraction of circle. Red at 0 */
  369.     UInt16                             saturation;                    /* 0..65535 */
  370.     UInt16                             value;                        /* 0..65535 */
  371. };
  372. typedef struct CMHSVColor                CMHSVColor;
  373.  
  374. struct CMLabColor {
  375.     UInt16                             L;                            /* 0..65535 maps to 0..100 */
  376.     UInt16                             a;                            /* 0..65535 maps to -128..127.996 */
  377.     UInt16                             b;                            /* 0..65535 maps to -128..127.996 */
  378. };
  379. typedef struct CMLabColor                CMLabColor;
  380.  
  381. struct CMLuvColor {
  382.     UInt16                             L;                            /* 0..65535 maps to 0..100 */
  383.     UInt16                             u;                            /* 0..65535 maps to -128..127.996 */
  384.     UInt16                             v;                            /* 0..65535 maps to -128..127.996 */
  385. };
  386. typedef struct CMLuvColor                CMLuvColor;
  387.  
  388. struct CMYxyColor {
  389.     UInt16                             capY;                        /* 0..65535 maps to 0..1 */
  390.     UInt16                             x;                            /* 0..65535 maps to 0..1 */
  391.     UInt16                             y;                            /* 0..65535 maps to 0..1 */
  392. };
  393. typedef struct CMYxyColor                CMYxyColor;
  394.  
  395. struct CMGrayColor {
  396.     UInt16                             gray;                        /* 0..65535 */
  397. };
  398. typedef struct CMGrayColor                CMGrayColor;
  399.  
  400. struct CMMultichannel5Color {
  401.     UInt8                             components[5];                /* 0..255 */
  402. };
  403. typedef struct CMMultichannel5Color        CMMultichannel5Color;
  404.  
  405. struct CMMultichannel6Color {
  406.     UInt8                             components[6];                /* 0..255 */
  407. };
  408. typedef struct CMMultichannel6Color        CMMultichannel6Color;
  409.  
  410. struct CMMultichannel7Color {
  411.     UInt8                             components[7];                /* 0..255 */
  412. };
  413. typedef struct CMMultichannel7Color        CMMultichannel7Color;
  414.  
  415. struct CMMultichannel8Color {
  416.     UInt8                             components[8];                /* 0..255 */
  417. };
  418. typedef struct CMMultichannel8Color        CMMultichannel8Color;
  419.  
  420. struct CMNamedColor {
  421.     UInt32                             namedColorIndex;            /* 0..a lot */
  422. };
  423. typedef struct CMNamedColor                CMNamedColor;
  424.  
  425. union CMColor {
  426.     CMRGBColor                         rgb;
  427.     CMHSVColor                         hsv;
  428.     CMHLSColor                         hls;
  429.     CMXYZColor                         XYZ;
  430.     CMLabColor                         Lab;
  431.     CMLuvColor                         Luv;
  432.     CMYxyColor                         Yxy;
  433.     CMCMYKColor                     cmyk;
  434.     CMCMYColor                         cmy;
  435.     CMGrayColor                     gray;
  436.     CMMultichannel5Color             mc5;
  437.     CMMultichannel6Color             mc6;
  438.     CMMultichannel7Color             mc7;
  439.     CMMultichannel8Color             mc8;
  440.     CMNamedColor                     namedColor;
  441. };
  442. typedef union CMColor                    CMColor;
  443.  
  444. struct CMProfileSearchRecord {
  445.     CMHeader                         header;
  446.     UInt32                             fieldMask;
  447.     UInt32                             reserved[2];
  448. };
  449. typedef struct CMProfileSearchRecord    CMProfileSearchRecord;
  450. typedef CMProfileSearchRecord *            CMProfileSearchRecordPtr;
  451. typedef CMProfileSearchRecordPtr *        CMProfileSearchRecordHandle;
  452. /* Search definition for 2.0 */
  453.  
  454. struct CMSearchRecord {
  455.     OSType                             CMMType;
  456.     OSType                             profileClass;
  457.     OSType                             dataColorSpace;
  458.     OSType                             profileConnectionSpace;
  459.     UInt32                             deviceManufacturer;
  460.     UInt32                             deviceModel;
  461.     UInt32                             deviceAttributes[2];
  462.     UInt32                             profileFlags;
  463.     UInt32                             searchMask;
  464.     CMProfileFilterUPP                 filter;
  465. };
  466. typedef struct CMSearchRecord            CMSearchRecord;
  467. /* CMMInfo structure */
  468.  
  469. struct CMMInfo {
  470.     UInt32                             dataSize;                    /* Size of this structure - compatibility*/
  471.     OSType                             CMMType;                    /* Signature, e.g. 'KCMS'*/
  472.     OSType                             CMMMfr;                        /* Vendor, e.g. 'appl'*/
  473.     UInt32                             CMMVersion;                    /* cmm version number*/
  474.     unsigned char                     ASCIIName[32];                /* pascal string - name*/
  475.     unsigned char                     ASCIIDesc[256];                /* pascal string - description or copyright*/
  476.     UniCharCount                     UniCodeNameCount;            /* count of UniChars in following array*/
  477.     UniChar                         UniCodeName[32];            /* the name in UniCode chars*/
  478.     UniCharCount                     UniCodeDescCount;            /* count of UniChars in following array*/
  479.     UniChar                         UniCodeDesc[256];            /* the description in UniCode chars*/
  480. };
  481. typedef struct CMMInfo                    CMMInfo;
  482. /* GetCWInfo structures */
  483.  
  484. struct CMMInfoRecord {
  485.     OSType                             CMMType;
  486.     long                             CMMVersion;
  487. };
  488. typedef struct CMMInfoRecord            CMMInfoRecord;
  489.  
  490. struct CMCWInfoRecord {
  491.     UInt32                             cmmCount;
  492.     CMMInfoRecord                     cmmInfo[2];
  493. };
  494. typedef struct CMCWInfoRecord            CMCWInfoRecord;
  495. /* profile identifier structures */
  496.  
  497. struct CMProfileIdentifier {
  498.     CM2Header                         profileHeader;
  499.     CMDateTime                         calibrationDate;
  500.     UInt32                             ASCIIProfileDescriptionLen;
  501.     char                             ASCIIProfileDescription[1];    /* variable length */
  502. };
  503. typedef struct CMProfileIdentifier        CMProfileIdentifier;
  504. typedef CMProfileIdentifier *            CMProfileIdentifierPtr;
  505. /* packing formats */
  506.  
  507. enum {
  508.     cmNoColorPacking            = 0x0000,
  509.     cmWord5ColorPacking            = 0x0500,
  510.     cmWord565ColorPacking        = 0x0600,
  511.     cmLong8ColorPacking            = 0x0800,
  512.     cmLong10ColorPacking        = 0x0A00,
  513.     cmAlphaFirstPacking            = 0x1000,
  514.     cmOneBitDirectPacking        = 0x0B00,
  515.     cmAlphaLastPacking            = 0x0000,
  516.     cm8_8ColorPacking            = 0x2800,
  517.     cm16_8ColorPacking            = 0x2000,
  518.     cm24_8ColorPacking            = 0x2100,
  519.     cm32_8ColorPacking            = cmLong8ColorPacking,
  520.     cm40_8ColorPacking            = 0x2200,
  521.     cm48_8ColorPacking            = 0x2300,
  522.     cm56_8ColorPacking            = 0x2400,
  523.     cm64_8ColorPacking            = 0x2500,
  524.     cm32_16ColorPacking            = 0x2600,
  525.     cm48_16ColorPacking            = 0x2900,
  526.     cm64_16ColorPacking            = 0x2A00,
  527.     cm32_32ColorPacking            = 0x2700,
  528.     cmLittleEndianPacking        = 0x4000,
  529.     cmReverseChannelPacking        = 0x8000
  530. };
  531.  
  532. /* general colorspaces */
  533.  
  534. enum {
  535.     cmNoSpace                    = 0,
  536.     cmRGBSpace                    = 1,
  537.     cmCMYKSpace                    = 2,
  538.     cmHSVSpace                    = 3,
  539.     cmHLSSpace                    = 4,
  540.     cmYXYSpace                    = 5,
  541.     cmXYZSpace                    = 6,
  542.     cmLUVSpace                    = 7,
  543.     cmLABSpace                    = 8,
  544.     cmReservedSpace1            = 9,
  545.     cmGraySpace                    = 10,
  546.     cmReservedSpace2            = 11,
  547.     cmGamutResultSpace            = 12,
  548.     cmNamedIndexedSpace            = 16,
  549.     cmMCFiveSpace                = 17,
  550.     cmMCSixSpace                = 18,
  551.     cmMCSevenSpace                = 19,
  552.     cmMCEightSpace                = 20,
  553.     cmAlphaSpace                = 0x80,
  554.     cmRGBASpace                    = cmRGBSpace + cmAlphaSpace,
  555.     cmGrayASpace                = cmGraySpace + cmAlphaSpace
  556. };
  557.  
  558. /* supported CMBitmapColorSpaces - Each of the following is a */
  559. /* combination of a general colospace and a packing formats. */
  560. /* Each can also be or'd with cmReverseChannelPacking. */
  561.  
  562. enum {
  563.     cmGray8Space                = cmGraySpace + cm8_8ColorPacking,
  564.     cmGrayA16Space                = cmGrayASpace + cm16_8ColorPacking,
  565.     cmGray16Space                = cmGraySpace,
  566.     cmGrayA32Space                = cmGrayASpace,
  567.     cmGray16LSpace                = cmGraySpace + cmLittleEndianPacking,
  568.     cmGrayA32LSpace                = cmGrayASpace + cmLittleEndianPacking,
  569.     cmRGB16Space                = cmRGBSpace + cmWord5ColorPacking,
  570.     cmRGB16LSpace                = cmRGBSpace + cmWord5ColorPacking + cmLittleEndianPacking,
  571.     cmRGB565Space                = cmRGBSpace + cmWord565ColorPacking,
  572.     cmRGB565LSpace                = cmRGBSpace + cmWord565ColorPacking + cmLittleEndianPacking,
  573.     cmRGB24Space                = cmRGBSpace + cm24_8ColorPacking,
  574.     cmRGB32Space                = cmRGBSpace + cm32_8ColorPacking,
  575.     cmRGB48Space                = cmRGBSpace + cm48_16ColorPacking,
  576.     cmRGB48LSpace                = cmRGBSpace + cm48_16ColorPacking + cmLittleEndianPacking,
  577.     cmARGB32Space                = cmRGBASpace + cm32_8ColorPacking + cmAlphaFirstPacking,
  578.     cmARGB64Space                = cmRGBASpace + cm64_16ColorPacking + cmAlphaFirstPacking,
  579.     cmARGB64LSpace                = cmRGBASpace + cm64_16ColorPacking + cmAlphaFirstPacking + cmLittleEndianPacking,
  580.     cmRGBA32Space                = cmRGBASpace + cm32_8ColorPacking + cmAlphaLastPacking,
  581.     cmRGBA64Space                = cmRGBASpace + cm64_16ColorPacking + cmAlphaLastPacking,
  582.     cmRGBA64LSpace                = cmRGBASpace + cm64_16ColorPacking + cmAlphaLastPacking + cmLittleEndianPacking,
  583.     cmCMYK32Space                = cmCMYKSpace + cm32_8ColorPacking,
  584.     cmCMYK64Space                = cmCMYKSpace + cm64_16ColorPacking,
  585.     cmCMYK64LSpace                = cmCMYKSpace + cm64_16ColorPacking + cmLittleEndianPacking,
  586.     cmHSV32Space                = cmHSVSpace + cmLong10ColorPacking,
  587.     cmHLS32Space                = cmHLSSpace + cmLong10ColorPacking,
  588.     cmYXY32Space                = cmYXYSpace + cmLong10ColorPacking,
  589.     cmXYZ24Space                = cmXYZSpace + cm24_8ColorPacking,
  590.     cmXYZ32Space                = cmXYZSpace + cmLong10ColorPacking,
  591.     cmXYZ48Space                = cmXYZSpace + cm48_16ColorPacking,
  592.     cmXYZ48LSpace                = cmXYZSpace + cm48_16ColorPacking + cmLittleEndianPacking,
  593.     cmLUV32Space                = cmLUVSpace + cmLong10ColorPacking,
  594.     cmLAB24Space                = cmLABSpace + cm24_8ColorPacking,
  595.     cmLAB32Space                = cmLABSpace + cmLong10ColorPacking,
  596.     cmLAB48Space                = cmLABSpace + cm48_16ColorPacking,
  597.     cmLAB48LSpace                = cmLABSpace + cm48_16ColorPacking + cmLittleEndianPacking,
  598.     cmGamutResult1Space            = cmOneBitDirectPacking + cmGamutResultSpace,
  599.     cmNamedIndexed32Space        = cm32_32ColorPacking + cmNamedIndexedSpace,
  600.     cmNamedIndexed32LSpace        = cm32_32ColorPacking + cmNamedIndexedSpace + cmLittleEndianPacking,
  601.     cmMCFive8Space                = cm40_8ColorPacking + cmMCFiveSpace,
  602.     cmMCSix8Space                = cm48_8ColorPacking + cmMCSixSpace,
  603.     cmMCSeven8Space                = cm56_8ColorPacking + cmMCSevenSpace,
  604.     cmMCEight8Space                = cm64_8ColorPacking + cmMCEightSpace
  605. };
  606.  
  607.  
  608.  
  609. typedef UInt32                             CMBitmapColorSpace;
  610.  
  611. struct CMBitmap {
  612.     char *                            image;
  613.     long                             width;
  614.     long                             height;
  615.     long                             rowBytes;
  616.     long                             pixelSize;
  617.     CMBitmapColorSpace                 space;
  618.     long                             user1;
  619.     long                             user2;
  620. };
  621. typedef struct CMBitmap                    CMBitmap;
  622.  
  623. /* Classic Print Manager Stuff */
  624. #if TARGET_OS_MAC
  625.  
  626. enum {
  627.     enableColorMatchingOp        = 12,
  628.     registerProfileOp            = 13
  629. };
  630.  
  631. #endif  /* TARGET_OS_MAC */
  632.  
  633. /* Profile Locations */
  634.  
  635. enum {
  636.     CS_MAX_PATH                    = 256
  637. };
  638.  
  639.  
  640. enum {
  641.     cmNoProfileBase                = 0,
  642.     cmFileBasedProfile            = 1,
  643.     cmHandleBasedProfile        = 2,
  644.     cmPtrBasedProfile            = 3,
  645.     cmProcedureBasedProfile        = 4,
  646.     cmPathBasedProfile            = 5,
  647.     cmBufferBasedProfile        = 6
  648. };
  649.  
  650.  
  651. struct CMFileLocation {
  652.     FSSpec                             spec;
  653. };
  654. typedef struct CMFileLocation            CMFileLocation;
  655.  
  656. struct CMHandleLocation {
  657.     Handle                             h;
  658. };
  659. typedef struct CMHandleLocation            CMHandleLocation;
  660.  
  661. struct CMPtrLocation {
  662.     Ptr                             p;
  663. };
  664. typedef struct CMPtrLocation            CMPtrLocation;
  665.  
  666. struct CMProcedureLocation {
  667.     CMProfileAccessUPP                 proc;
  668.     void *                            refCon;
  669. };
  670. typedef struct CMProcedureLocation        CMProcedureLocation;
  671.  
  672. struct CMPathLocation {
  673.     char                             path[256];
  674. };
  675. typedef struct CMPathLocation            CMPathLocation;
  676.  
  677. struct CMBufferLocation {
  678.     void *                            buffer;
  679.     UInt32                             size;
  680. };
  681. typedef struct CMBufferLocation            CMBufferLocation;
  682.  
  683. union CMProfLoc {
  684.     CMFileLocation                     fileLoc;
  685.     CMHandleLocation                 handleLoc;
  686.     CMPtrLocation                     ptrLoc;
  687.     CMProcedureLocation             procLoc;
  688.     CMPathLocation                     pathLoc;
  689.     CMBufferLocation                 bufferLoc;
  690. };
  691. typedef union CMProfLoc                    CMProfLoc;
  692.  
  693. struct CMProfileLocation {
  694.     short                             locType;
  695.     CMProfLoc                         u;
  696. };
  697. typedef struct CMProfileLocation        CMProfileLocation;
  698. #if TARGET_OS_MAC
  699.  
  700. enum {
  701.     cmOriginalProfileLocationSize = 72,
  702.     cmCurrentProfileLocationSize = 2 + CS_MAX_PATH
  703. };
  704.  
  705. #else
  706.  
  707. enum {
  708.     cmOriginalProfileLocationSize = 2 + CS_MAX_PATH,
  709.     cmCurrentProfileLocationSize = 2 + CS_MAX_PATH
  710. };
  711.  
  712. #endif  /* TARGET_OS_MAC */
  713.  
  714. /* Struct and enums used for Profile iteration */
  715.  
  716. enum {
  717.     cmProfileIterateDataVersion1 = 0x00010000,
  718.     cmProfileIterateDataVersion2 = 0x00020000
  719. };
  720.  
  721.  
  722. struct CMProfileIterateData {
  723.     UInt32                             dataVersion;                /* cmProfileIterateDataVersion2 */
  724.     CM2Header                         header;
  725.     ScriptCode                         code;
  726.     Str255                             name;
  727.     CMProfileLocation                 location;
  728.     UniCharCount                     uniCodeNameCount;
  729.     UniChar *                        uniCodeName;
  730.     unsigned char *                    asciiName;
  731.     CMMakeAndModel *                makeAndModel;
  732. };
  733. typedef struct CMProfileIterateData        CMProfileIterateData;
  734. /* Caller-supplied callback function for Profile & CMM iteration */
  735. typedef CALLBACK_API( OSErr , CMProfileIterateProcPtr )(CMProfileIterateData *iterateData, void *refCon);
  736. typedef CALLBACK_API( OSErr , CMMIterateProcPtr )(CMMInfo *iterateData, void *refCon);
  737. typedef STACK_UPP_TYPE(CMProfileIterateProcPtr)                 CMProfileIterateUPP;
  738. typedef STACK_UPP_TYPE(CMMIterateProcPtr)                         CMMIterateUPP;
  739. enum { uppCMProfileIterateProcInfo = 0x000003E0 };                 /* pascal 2_bytes Func(4_bytes, 4_bytes) */
  740. enum { uppCMMIterateProcInfo = 0x000003E0 };                     /* pascal 2_bytes Func(4_bytes, 4_bytes) */
  741. #if MIXEDMODE_CALLS_ARE_FUNCTIONS
  742. EXTERN_API(CMProfileIterateUPP)
  743. NewCMProfileIterateProc           (CMProfileIterateProcPtr    userRoutine);
  744. EXTERN_API(CMMIterateUPP)
  745. NewCMMIterateProc               (CMMIterateProcPtr        userRoutine);
  746. EXTERN_API(OSErr)
  747. CallCMProfileIterateProc       (CMProfileIterateUPP        userRoutine,
  748.                                 CMProfileIterateData *    iterateData,
  749.                                 void *                    refCon);
  750. EXTERN_API(OSErr)
  751. CallCMMIterateProc               (CMMIterateUPP            userRoutine,
  752.                                 CMMInfo *                iterateData,
  753.                                 void *                    refCon);
  754. #else
  755. #define NewCMProfileIterateProc(userRoutine)                     (CMProfileIterateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMProfileIterateProcInfo, GetCurrentArchitecture())
  756. #define NewCMMIterateProc(userRoutine)                             (CMMIterateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMMIterateProcInfo, GetCurrentArchitecture())
  757. #define CallCMProfileIterateProc(userRoutine, iterateData, refCon)  CALL_TWO_PARAMETER_UPP((userRoutine), uppCMProfileIterateProcInfo, (iterateData), (refCon))
  758. #define CallCMMIterateProc(userRoutine, iterateData, refCon)     CALL_TWO_PARAMETER_UPP((userRoutine), uppCMMIterateProcInfo, (iterateData), (refCon))
  759. #endif
  760. /* Profile file and element access */
  761. EXTERN_API( CMError )
  762. CMNewProfile                    (CMProfileRef *            prof,
  763.                                  const CMProfileLocation * theProfile)                        FOURWORDINLINE(0x203C, 0x0008, 0x001B, 0xABEE);
  764.  
  765. EXTERN_API( CMError )
  766. CMOpenProfile                    (CMProfileRef *            prof,
  767.                                  const CMProfileLocation * theProfile)                        FOURWORDINLINE(0x203C, 0x0008, 0x001C, 0xABEE);
  768.  
  769. EXTERN_API( CMError )
  770. CMCloseProfile                    (CMProfileRef             prof)                                FOURWORDINLINE(0x203C, 0x0004, 0x001D, 0xABEE);
  771.  
  772. EXTERN_API( CMError )
  773. CMUpdateProfile                    (CMProfileRef             prof)                                FOURWORDINLINE(0x203C, 0x0004, 0x0034, 0xABEE);
  774.  
  775. EXTERN_API( CMError )
  776. CMCopyProfile                    (CMProfileRef *            targetProf,
  777.                                  const CMProfileLocation * targetLocation,
  778.                                  CMProfileRef             srcProf)                            FOURWORDINLINE(0x203C, 0x000C, 0x0025, 0xABEE);
  779.  
  780. EXTERN_API( CMError )
  781. CMValidateProfile                (CMProfileRef             prof,
  782.                                  Boolean *                valid,
  783.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x000C, 0x0026, 0xABEE);
  784.  
  785. EXTERN_API( CMError )
  786. CMGetProfileLocation            (CMProfileRef             prof,
  787.                                  CMProfileLocation *    theProfile)                            FOURWORDINLINE(0x203C, 0x0008, 0x003C, 0xABEE);
  788.  
  789. EXTERN_API( CMError )
  790. NCMGetProfileLocation            (CMProfileRef             prof,
  791.                                  CMProfileLocation *    theProfile,
  792.                                  UInt32 *                locationSize)                        FOURWORDINLINE(0x203C, 0x000C, 0x0059, 0xABEE);
  793.  
  794. EXTERN_API( CMError )
  795. CMFlattenProfile                (CMProfileRef             prof,
  796.                                  UInt32                 flags,
  797.                                  CMFlattenUPP             proc,
  798.                                  void *                    refCon,
  799.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0014, 0x0031, 0xABEE);
  800.  
  801. #if TARGET_OS_MAC
  802. EXTERN_API( CMError )
  803. CMUnflattenProfile                (FSSpec *                resultFileSpec,
  804.                                  CMFlattenUPP             proc,
  805.                                  void *                    refCon,
  806.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0010, 0x0032, 0xABEE);
  807.  
  808. #endif  /* TARGET_OS_MAC */
  809.  
  810. EXTERN_API( CMError )
  811. CMGetProfileHeader                (CMProfileRef             prof,
  812.                                  CMAppleProfileHeader *    header)                                FOURWORDINLINE(0x203C, 0x0008, 0x0039, 0xABEE);
  813.  
  814. EXTERN_API( CMError )
  815. CMSetProfileHeader                (CMProfileRef             prof,
  816.                                  const CMAppleProfileHeader * header)                        FOURWORDINLINE(0x203C, 0x0008, 0x003A, 0xABEE);
  817.  
  818. EXTERN_API( CMError )
  819. CMProfileElementExists            (CMProfileRef             prof,
  820.                                  OSType                 tag,
  821.                                  Boolean *                found)                                FOURWORDINLINE(0x203C, 0x000C, 0x001E, 0xABEE);
  822.  
  823. EXTERN_API( CMError )
  824. CMCountProfileElements            (CMProfileRef             prof,
  825.                                  UInt32 *                elementCount)                        FOURWORDINLINE(0x203C, 0x0008, 0x001F, 0xABEE);
  826.  
  827. EXTERN_API( CMError )
  828. CMGetProfileElement                (CMProfileRef             prof,
  829.                                  OSType                 tag,
  830.                                  UInt32 *                elementSize,
  831.                                  void *                    elementData)                        FOURWORDINLINE(0x203C, 0x0010, 0x0020, 0xABEE);
  832.  
  833. EXTERN_API( CMError )
  834. CMSetProfileElement                (CMProfileRef             prof,
  835.                                  OSType                 tag,
  836.                                  UInt32                 elementSize,
  837.                                  void *                    elementData)                        FOURWORDINLINE(0x203C, 0x0010, 0x0023, 0xABEE);
  838.  
  839. EXTERN_API( CMError )
  840. CMSetProfileElementSize            (CMProfileRef             prof,
  841.                                  OSType                 tag,
  842.                                  UInt32                 elementSize)                        FOURWORDINLINE(0x203C, 0x000C, 0x0038, 0xABEE);
  843.  
  844. EXTERN_API( CMError )
  845. CMSetProfileElementReference    (CMProfileRef             prof,
  846.                                  OSType                 elementTag,
  847.                                  OSType                 referenceTag)                        FOURWORDINLINE(0x203C, 0x000C, 0x0035, 0xABEE);
  848.  
  849. EXTERN_API( CMError )
  850. CMGetPartialProfileElement        (CMProfileRef             prof,
  851.                                  OSType                 tag,
  852.                                  UInt32                 offset,
  853.                                  UInt32 *                byteCount,
  854.                                  void *                    elementData)                        FOURWORDINLINE(0x203C, 0x0014, 0x0036, 0xABEE);
  855.  
  856. EXTERN_API( CMError )
  857. CMSetPartialProfileElement        (CMProfileRef             prof,
  858.                                  OSType                 tag,
  859.                                  UInt32                 offset,
  860.                                  UInt32                 byteCount,
  861.                                  void *                    elementData)                        FOURWORDINLINE(0x203C, 0x0014, 0x0037, 0xABEE);
  862.  
  863. EXTERN_API( CMError )
  864. CMGetIndProfileElementInfo        (CMProfileRef             prof,
  865.                                  UInt32                 index,
  866.                                  OSType *                tag,
  867.                                  UInt32 *                elementSize,
  868.                                  Boolean *                refs)                                FOURWORDINLINE(0x203C, 0x0014, 0x0021, 0xABEE);
  869.  
  870. EXTERN_API( CMError )
  871. CMGetIndProfileElement            (CMProfileRef             prof,
  872.                                  UInt32                 index,
  873.                                  UInt32 *                elementSize,
  874.                                  void *                    elementData)                        FOURWORDINLINE(0x203C, 0x0010, 0x0022, 0xABEE);
  875.  
  876. EXTERN_API( CMError )
  877. CMRemoveProfileElement            (CMProfileRef             prof,
  878.                                  OSType                 tag)                                FOURWORDINLINE(0x203C, 0x0008, 0x0024, 0xABEE);
  879.  
  880. EXTERN_API( CMError )
  881. CMGetScriptProfileDescription    (CMProfileRef             prof,
  882.                                  Str255                 name,
  883.                                  ScriptCode *            code)                                FOURWORDINLINE(0x203C, 0x000C, 0x003E, 0xABEE);
  884.  
  885. EXTERN_API( CMError )
  886. CMGetProfileDescriptions        (CMProfileRef             prof,
  887.                                  char *                    aName,
  888.                                  UInt32 *                aCount,
  889.                                  Str255                 mName,
  890.                                  ScriptCode *            mCode,
  891.                                  UniChar *                uName,
  892.                                  UniCharCount *            uCount)                                FOURWORDINLINE(0x203C, 0x001A, 0x0067, 0xABEE);
  893.  
  894. EXTERN_API( CMError )
  895. CMSetProfileDescriptions        (CMProfileRef             prof,
  896.                                  const char *            aName,
  897.                                  UInt32                 aCount,
  898.                                  ConstStr255Param         mName,
  899.                                  ScriptCode             mCode,
  900.                                  const UniChar *        uName,
  901.                                  UniCharCount             uCount)                                FOURWORDINLINE(0x203C, 0x001A, 0x0068, 0xABEE);
  902.  
  903. EXTERN_API( CMError )
  904. CMCloneProfileRef                (CMProfileRef             prof)                                FOURWORDINLINE(0x203C, 0x0004, 0x0042, 0xABEE);
  905.  
  906. EXTERN_API( CMError )
  907. CMGetProfileRefCount            (CMProfileRef             prof,
  908.                                  long *                    count)                                FOURWORDINLINE(0x203C, 0x0008, 0x0043, 0xABEE);
  909.  
  910. EXTERN_API( CMError )
  911. CMProfileModified                (CMProfileRef             prof,
  912.                                  Boolean *                modified)                            FOURWORDINLINE(0x203C, 0x0008, 0x0044, 0xABEE);
  913.  
  914.  
  915. /* named Color access functions */
  916. EXTERN_API( CMError )
  917. CMGetNamedColorInfo                (CMProfileRef             prof,
  918.                                  UInt32 *                deviceChannels,
  919.                                  OSType *                deviceColorSpace,
  920.                                  OSType *                PCSColorSpace,
  921.                                  UInt32 *                count,
  922.                                  StringPtr                 prefix,
  923.                                  StringPtr                 suffix)                                FOURWORDINLINE(0x203C, 0x001C, 0x0046, 0xABEE);
  924.  
  925. EXTERN_API( CMError )
  926. CMGetNamedColorValue            (CMProfileRef             prof,
  927.                                  StringPtr                 name,
  928.                                  CMColor *                deviceColor,
  929.                                  CMColor *                PCSColor)                            FOURWORDINLINE(0x203C, 0x0010, 0x0047, 0xABEE);
  930.  
  931. EXTERN_API( CMError )
  932. CMGetIndNamedColorValue            (CMProfileRef             prof,
  933.                                  UInt32                 index,
  934.                                  CMColor *                deviceColor,
  935.                                  CMColor *                PCSColor)                            FOURWORDINLINE(0x203C, 0x0010, 0x0048, 0xABEE);
  936.  
  937. EXTERN_API( CMError )
  938. CMGetNamedColorIndex            (CMProfileRef             prof,
  939.                                  StringPtr                 name,
  940.                                  UInt32 *                index)                                FOURWORDINLINE(0x203C, 0x000C, 0x0049, 0xABEE);
  941.  
  942. EXTERN_API( CMError )
  943. CMGetNamedColorName                (CMProfileRef             prof,
  944.                                  UInt32                 index,
  945.                                  StringPtr                 name)                                FOURWORDINLINE(0x203C, 0x000C, 0x004A, 0xABEE);
  946.  
  947.  
  948. /* General-purpose matching functions */
  949. EXTERN_API( CMError )
  950. NCWNewColorWorld                (CMWorldRef *            cw,
  951.                                  CMProfileRef             src,
  952.                                  CMProfileRef             dst)                                FOURWORDINLINE(0x203C, 0x000C, 0x0014, 0xABEE);
  953.  
  954. EXTERN_API( CMError )
  955. CWConcatColorWorld                (CMWorldRef *            cw,
  956.                                  CMConcatProfileSet *    profileSet)                            FOURWORDINLINE(0x203C, 0x0008, 0x0015, 0xABEE);
  957.  
  958. EXTERN_API( CMError )
  959. CWNewLinkProfile                (CMProfileRef *            prof,
  960.                                  const CMProfileLocation * targetLocation,
  961.                                  CMConcatProfileSet *    profileSet)                            FOURWORDINLINE(0x203C, 0x000C, 0x0033, 0xABEE);
  962.  
  963. EXTERN_API( CMError )
  964. NCWConcatColorWorld                (CMWorldRef *            cw,
  965.                                  NCMConcatProfileSet *    profileSet,
  966.                                  CMConcatCallBackUPP     proc,
  967.                                  void *                    refCon)                                FOURWORDINLINE(0x203C, 0x0008, 0x0061, 0xABEE);
  968.  
  969. EXTERN_API( CMError )
  970. NCWNewLinkProfile                (CMProfileRef *            prof,
  971.                                  const CMProfileLocation * targetLocation,
  972.                                  NCMConcatProfileSet *    profileSet,
  973.                                  CMConcatCallBackUPP     proc,
  974.                                  void *                    refCon)                                FOURWORDINLINE(0x203C, 0x000C, 0x0062, 0xABEE);
  975.  
  976. EXTERN_API( void )
  977. CWDisposeColorWorld                (CMWorldRef             cw)                                    FOURWORDINLINE(0x203C, 0x0004, 0x0001, 0xABEE);
  978.  
  979. EXTERN_API( CMError )
  980. CWMatchColors                    (CMWorldRef             cw,
  981.                                  CMColor *                myColors,
  982.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0002, 0xABEE);
  983.  
  984. EXTERN_API( CMError )
  985. CWCheckColors                    (CMWorldRef             cw,
  986.                                  CMColor *                myColors,
  987.                                  UInt32                 count,
  988.                                  UInt32 *                result)                                FOURWORDINLINE(0x203C, 0x0010, 0x0003, 0xABEE);
  989.  
  990. EXTERN_API( CMError )
  991. CWMatchBitmap                    (CMWorldRef             cw,
  992.                                  CMBitmap *                bitmap,
  993.                                  CMBitmapCallBackUPP     progressProc,
  994.                                  void *                    refCon,
  995.                                  CMBitmap *                matchedBitmap)                        FOURWORDINLINE(0x203C, 0x0010, 0x002C, 0xABEE);
  996.  
  997. EXTERN_API( CMError )
  998. CWCheckBitmap                    (CMWorldRef             cw,
  999.                                  const CMBitmap *        bitmap,
  1000.                                  CMBitmapCallBackUPP     progressProc,
  1001.                                  void *                    refCon,
  1002.                                  CMBitmap *                resultBitmap)                        FOURWORDINLINE(0x203C, 0x0014, 0x002D, 0xABEE);
  1003.  
  1004.  
  1005. /* Quickdraw-specific matching */
  1006. EXTERN_API( CMError )
  1007. CWMatchPixMap                    (CMWorldRef             cw,
  1008.                                  PixMap *                myPixMap,
  1009.                                  CMBitmapCallBackUPP     progressProc,
  1010.                                  void *                    refCon)                                FOURWORDINLINE(0x203C, 0x0010, 0x0004, 0xABEE);
  1011.  
  1012. EXTERN_API( CMError )
  1013. CWCheckPixMap                    (CMWorldRef             cw,
  1014.                                  PixMap *                myPixMap,
  1015.                                  CMBitmapCallBackUPP     progressProc,
  1016.                                  void *                    refCon,
  1017.                                  BitMap *                resultBitMap)                        FOURWORDINLINE(0x203C, 0x0014, 0x0007, 0xABEE);
  1018.  
  1019. #if TARGET_OS_MAC
  1020. EXTERN_API( CMError )
  1021. NCMBeginMatching                (CMProfileRef             src,
  1022.                                  CMProfileRef             dst,
  1023.                                  CMMatchRef *            myRef)                                FOURWORDINLINE(0x203C, 0x000C, 0x0016, 0xABEE);
  1024.  
  1025. EXTERN_API( void )
  1026. CMEndMatching                    (CMMatchRef             myRef)                                FOURWORDINLINE(0x203C, 0x0004, 0x000B, 0xABEE);
  1027.  
  1028. EXTERN_API( void )
  1029. NCMDrawMatchedPicture            (PicHandle                 myPicture,
  1030.                                  CMProfileRef             dst,
  1031.                                  Rect *                    myRect)                                FOURWORDINLINE(0x203C, 0x000C, 0x0017, 0xABEE);
  1032.  
  1033. EXTERN_API( void )
  1034. CMEnableMatchingComment            (Boolean                 enableIt)                            FOURWORDINLINE(0x203C, 0x0002, 0x000D, 0xABEE);
  1035.  
  1036. EXTERN_API( CMError )
  1037. NCMUseProfileComment            (CMProfileRef             prof,
  1038.                                  UInt32                 flags)                                FOURWORDINLINE(0x203C, 0x0008, 0x003B, 0xABEE);
  1039.  
  1040. #endif  /* TARGET_OS_MAC */
  1041.  
  1042. #if TARGET_OS_WIN32
  1043. EXTERN_API( CMError )
  1044. CWMatchHBITMAP                    (CMWorldRef             cw,
  1045.                                  HBITMAP                 hBitmap,
  1046.                                  CMBitmapCallBackUPP     progressProc,
  1047.                                  void *                    refCon);
  1048.  
  1049. #endif  /* TARGET_OS_WIN32 */
  1050.  
  1051. EXTERN_API( CMError )
  1052. CMCreateProfileIdentifier        (CMProfileRef             prof,
  1053.                                  CMProfileIdentifierPtr  ident,
  1054.                                  UInt32 *                size)                                FOURWORDINLINE(0x203C, 0x000C, 0x0041, 0xABEE);
  1055.  
  1056.  
  1057. /* System Profile access */
  1058. EXTERN_API( CMError )
  1059. CMGetSystemProfile                (CMProfileRef *            prof)                                FOURWORDINLINE(0x203C, 0x0004, 0x0018, 0xABEE);
  1060.  
  1061. EXTERN_API( CMError )
  1062. CMSetSystemProfile                (const FSSpec *            profileFileSpec)                    FOURWORDINLINE(0x203C, 0x0004, 0x0019, 0xABEE);
  1063.  
  1064. EXTERN_API( CMError )
  1065. NCMSetSystemProfile                (const CMProfileLocation * profLoc)                            FOURWORDINLINE(0x203C, 0x0004, 0x0064, 0xABEE);
  1066.  
  1067. EXTERN_API( CMError )
  1068. CMGetDefaultProfileBySpace        (OSType                 dataColorSpace,
  1069.                                  CMProfileRef *            prof)                                FOURWORDINLINE(0x203C, 0x0008, 0x005A, 0xABEE);
  1070.  
  1071. EXTERN_API( CMError )
  1072. CMSetDefaultProfileBySpace        (OSType                 dataColorSpace,
  1073.                                  CMProfileRef             prof)                                FOURWORDINLINE(0x203C, 0x0008, 0x005B, 0xABEE);
  1074.  
  1075. #if TARGET_OS_MAC
  1076. EXTERN_API( CMError )
  1077. CMGetProfileByAVID                (AVIDType                 theAVID,
  1078.                                  CMProfileRef *            prof)                                FOURWORDINLINE(0x203C, 0x0008, 0x005C, 0xABEE);
  1079.  
  1080. EXTERN_API( CMError )
  1081. CMSetProfileByAVID                (AVIDType                 theAVID,
  1082.                                  CMProfileRef             prof)                                FOURWORDINLINE(0x203C, 0x0008, 0x005D, 0xABEE);
  1083.  
  1084. #endif  /* TARGET_OS_MAC */
  1085.  
  1086. /* Profile Management */
  1087. EXTERN_API( CMError )
  1088. CMNewProfileSearch                (CMSearchRecord *        searchSpec,
  1089.                                  void *                    refCon,
  1090.                                  UInt32 *                count,
  1091.                                  CMProfileSearchRef *    searchResult)                        FOURWORDINLINE(0x203C, 0x0010, 0x0027, 0xABEE);
  1092.  
  1093. EXTERN_API( CMError )
  1094. CMUpdateProfileSearch            (CMProfileSearchRef     search,
  1095.                                  void *                    refCon,
  1096.                                  UInt32 *                count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0028, 0xABEE);
  1097.  
  1098. EXTERN_API( void )
  1099. CMDisposeProfileSearch            (CMProfileSearchRef     search)                                FOURWORDINLINE(0x203C, 0x0004, 0x0029, 0xABEE);
  1100.  
  1101. EXTERN_API( CMError )
  1102. CMSearchGetIndProfile            (CMProfileSearchRef     search,
  1103.                                  UInt32                 index,
  1104.                                  CMProfileRef *            prof)                                FOURWORDINLINE(0x203C, 0x000C, 0x002A, 0xABEE);
  1105.  
  1106. EXTERN_API( CMError )
  1107. CMSearchGetIndProfileFileSpec    (CMProfileSearchRef     search,
  1108.                                  UInt32                 index,
  1109.                                  FSSpec *                profileFile)                        FOURWORDINLINE(0x203C, 0x000C, 0x002B, 0xABEE);
  1110.  
  1111. EXTERN_API( CMError )
  1112. CMProfileIdentifierFolderSearch    (CMProfileIdentifierPtr  ident,
  1113.                                  UInt32 *                matchedCount,
  1114.                                  CMProfileSearchRef *    searchResult)                        FOURWORDINLINE(0x203C, 0x000C, 0x003F, 0xABEE);
  1115.  
  1116. EXTERN_API( CMError )
  1117. CMProfileIdentifierListSearch    (CMProfileIdentifierPtr  ident,
  1118.                                  CMProfileRef *            profileList,
  1119.                                  UInt32                 listSize,
  1120.                                  UInt32 *                matchedCount,
  1121.                                  CMProfileRef *            matchedList)                        FOURWORDINLINE(0x203C, 0x0014, 0x0040, 0xABEE);
  1122.  
  1123. EXTERN_API( CMError )
  1124. CMIterateColorSyncFolder        (CMProfileIterateUPP     proc,
  1125.                                  UInt32 *                seed,
  1126.                                  UInt32 *                count,
  1127.                                  void *                    refCon)                                FOURWORDINLINE(0x203C, 0x0010, 0x0058, 0xABEE);
  1128.  
  1129. EXTERN_API( CMError )
  1130. NCMUnflattenProfile                (CMProfileLocation *    targetLocation,
  1131.                                  CMFlattenUPP             proc,
  1132.                                  void *                    refCon,
  1133.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0010, 0x0065, 0xABEE);
  1134.  
  1135. /* Utilities */
  1136. #if TARGET_OS_MAC
  1137. EXTERN_API( CMError )
  1138. CMGetColorSyncFolderSpec        (short                     vRefNum,
  1139.                                  Boolean                 createFolder,
  1140.                                  short *                foundVRefNum,
  1141.                                  long *                    foundDirID)                            FOURWORDINLINE(0x203C, 0x000C, 0x0011, 0xABEE);
  1142.  
  1143. #endif  /* TARGET_OS_MAC */
  1144.  
  1145. #if TARGET_OS_WIN32 || TARGET_OS_UNIX
  1146. EXTERN_API( CMError )
  1147. CMGetColorSyncFolderPath        (Boolean                 createFolder,
  1148.                                  char *                    lpBuffer,
  1149.                                  UInt32                 uSize);
  1150.  
  1151. #endif  /* TARGET_OS_WIN32 || TARGET_OS_UNIX */
  1152.  
  1153. EXTERN_API( CMError )
  1154. CMGetCWInfo                        (CMWorldRef             cw,
  1155.                                  CMCWInfoRecord *        info)                                FOURWORDINLINE(0x203C, 0x0008, 0x001A, 0xABEE);
  1156.  
  1157. EXTERN_API( CMError )
  1158. CMConvertProfile2to1            (CMProfileRef             profv2,
  1159.                                  CMProfileHandle *        profv1)                                FOURWORDINLINE(0x203C, 0x0008, 0x0045, 0xABEE);
  1160.  
  1161. EXTERN_API( CMError )
  1162. CMGetPreferredCMM                (OSType *                cmmType,
  1163.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0008, 0x005E, 0xABEE);
  1164.  
  1165. EXTERN_API( CMError )
  1166. CMIterateCMMInfo                (CMMIterateUPP             proc,
  1167.                                  UInt32 *                count,
  1168.                                  void *                    refCon)                                FOURWORDINLINE(0x203C, 0x000C, 0x0063, 0xABEE);
  1169.  
  1170. EXTERN_API( CMError )
  1171. CMGetColorSyncVersion            (UInt32 *                version)                            FOURWORDINLINE(0x203C, 0x0004, 0x0066, 0xABEE);
  1172.  
  1173. /* ColorSpace conversion functions */
  1174. EXTERN_API( CMError )
  1175. CMConvertXYZToLab                (const CMColor *        src,
  1176.                                  const CMXYZColor *        white,
  1177.                                  CMColor *                dst,
  1178.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x0010, 0x004B, 0xABEE);
  1179.  
  1180. EXTERN_API( CMError )
  1181. CMConvertLabToXYZ                (const CMColor *        src,
  1182.                                  const CMXYZColor *        white,
  1183.                                  CMColor *                dst,
  1184.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x0010, 0x004C, 0xABEE);
  1185.  
  1186. EXTERN_API( CMError )
  1187. CMConvertXYZToLuv                (const CMColor *        src,
  1188.                                  const CMXYZColor *        white,
  1189.                                  CMColor *                dst,
  1190.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x0010, 0x004D, 0xABEE);
  1191.  
  1192. EXTERN_API( CMError )
  1193. CMConvertLuvToXYZ                (const CMColor *        src,
  1194.                                  const CMXYZColor *        white,
  1195.                                  CMColor *                dst,
  1196.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x0010, 0x004E, 0xABEE);
  1197.  
  1198. EXTERN_API( CMError )
  1199. CMConvertXYZToYxy                (const CMColor *        src,
  1200.                                  CMColor *                dst,
  1201.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x000C, 0x004F, 0xABEE);
  1202.  
  1203. EXTERN_API( CMError )
  1204. CMConvertYxyToXYZ                (const CMColor *        src,
  1205.                                  CMColor *                dst,
  1206.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0050, 0xABEE);
  1207.  
  1208. EXTERN_API( CMError )
  1209. CMConvertRGBToHLS                (const CMColor *        src,
  1210.                                  CMColor *                dst,
  1211.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0051, 0xABEE);
  1212.  
  1213. EXTERN_API( CMError )
  1214. CMConvertHLSToRGB                (const CMColor *        src,
  1215.                                  CMColor *                dst,
  1216.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0052, 0xABEE);
  1217.  
  1218. EXTERN_API( CMError )
  1219. CMConvertRGBToHSV                (const CMColor *        src,
  1220.                                  CMColor *                dst,
  1221.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0053, 0xABEE);
  1222.  
  1223. EXTERN_API( CMError )
  1224. CMConvertHSVToRGB                (const CMColor *        src,
  1225.                                  CMColor *                dst,
  1226.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0054, 0xABEE);
  1227.  
  1228. EXTERN_API( CMError )
  1229. CMConvertRGBToGray                (const CMColor *        src,
  1230.                                  CMColor *                dst,
  1231.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0055, 0xABEE);
  1232.  
  1233. EXTERN_API( CMError )
  1234. CMConvertXYZToFixedXYZ            (const CMXYZColor *        src,
  1235.                                  CMFixedXYZColor *        dst,
  1236.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0056, 0xABEE);
  1237.  
  1238. EXTERN_API( CMError )
  1239. CMConvertFixedXYZToXYZ            (const CMFixedXYZColor * src,
  1240.                                  CMXYZColor *            dst,
  1241.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0057, 0xABEE);
  1242.  
  1243.  
  1244. /* PS-related */
  1245. EXTERN_API( CMError )
  1246. CMGetPS2ColorSpace                (CMProfileRef             srcProf,
  1247.                                  UInt32                 flags,
  1248.                                  CMFlattenUPP             proc,
  1249.                                  void *                    refCon,
  1250.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0014, 0x002E, 0xABEE);
  1251.  
  1252. EXTERN_API( CMError )
  1253. CMGetPS2ColorRenderingIntent    (CMProfileRef             srcProf,
  1254.                                  UInt32                 flags,
  1255.                                  CMFlattenUPP             proc,
  1256.                                  void *                    refCon,
  1257.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0014, 0x002F, 0xABEE);
  1258.  
  1259. EXTERN_API( CMError )
  1260. CMGetPS2ColorRendering            (CMProfileRef             srcProf,
  1261.                                  CMProfileRef             dstProf,
  1262.                                  UInt32                 flags,
  1263.                                  CMFlattenUPP             proc,
  1264.                                  void *                    refCon,
  1265.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0018, 0x0030, 0xABEE);
  1266.  
  1267. EXTERN_API( CMError )
  1268. CMGetPS2ColorRenderingVMSize    (CMProfileRef             srcProf,
  1269.                                  CMProfileRef             dstProf,
  1270.                                  UInt32 *                vmSize,
  1271.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0010, 0x003D, 0xABEE);
  1272.  
  1273.  
  1274. /* ColorSync 1.0 functions which have parallel 2.0 counterparts */
  1275. #if TARGET_OS_MAC
  1276. EXTERN_API( CMError )
  1277. CWNewColorWorld                    (CMWorldRef *            cw,
  1278.                                  CMProfileHandle         src,
  1279.                                  CMProfileHandle         dst)                                FOURWORDINLINE(0x203C, 0x000C, 0x0000, 0xABEE);
  1280.  
  1281. EXTERN_API( CMError )
  1282. ConcatenateProfiles                (CMProfileHandle         thru,
  1283.                                  CMProfileHandle         dst,
  1284.                                  CMProfileHandle *        newDst)                                FOURWORDINLINE(0x203C, 0x000C, 0x000C, 0xABEE);
  1285.  
  1286. EXTERN_API( CMError )
  1287. CMBeginMatching                    (CMProfileHandle         src,
  1288.                                  CMProfileHandle         dst,
  1289.                                  CMMatchRef *            myRef)                                FOURWORDINLINE(0x203C, 0x000C, 0x000A, 0xABEE);
  1290.  
  1291. EXTERN_API( void )
  1292. CMDrawMatchedPicture            (PicHandle                 myPicture,
  1293.                                  CMProfileHandle         dst,
  1294.                                  Rect *                    myRect)                                FOURWORDINLINE(0x203C, 0x000C, 0x0009, 0xABEE);
  1295.  
  1296. EXTERN_API( CMError )
  1297. CMUseProfileComment                (CMProfileHandle         profile)                            FOURWORDINLINE(0x203C, 0x0004, 0x0008, 0xABEE);
  1298.  
  1299. EXTERN_API( void )
  1300. CMGetProfileName                (CMProfileHandle         myProfile,
  1301.                                  CMIString *            IStringResult)                        FOURWORDINLINE(0x203C, 0x0008, 0x000E, 0xABEE);
  1302.  
  1303. EXTERN_API( long )
  1304. CMGetProfileAdditionalDataOffset (CMProfileHandle         myProfile)                            FOURWORDINLINE(0x203C, 0x0004, 0x000F, 0xABEE);
  1305.  
  1306.  
  1307. /* ProfileResponder functions */
  1308. EXTERN_API( CMError )
  1309. GetProfile                        (OSType                 deviceType,
  1310.                                  long                     refNum,
  1311.                                  CMProfileHandle         aProfile,
  1312.                                  CMProfileHandle *        returnedProfile)                    FOURWORDINLINE(0x203C, 0x0010, 0x0005, 0xABEE);
  1313.  
  1314. EXTERN_API( CMError )
  1315. SetProfile                        (OSType                 deviceType,
  1316.                                  long                     refNum,
  1317.                                  CMProfileHandle         newProfile)                            FOURWORDINLINE(0x203C, 0x000C, 0x0006, 0xABEE);
  1318.  
  1319. EXTERN_API( CMError )
  1320. SetProfileDescription            (OSType                 deviceType,
  1321.                                  long                     refNum,
  1322.                                  long                     deviceData,
  1323.                                  CMProfileHandle         hProfile)                            FOURWORDINLINE(0x203C, 0x0010, 0x0010, 0xABEE);
  1324.  
  1325. EXTERN_API( CMError )
  1326. GetIndexedProfile                (OSType                 deviceType,
  1327.                                  long                     refNum,
  1328.                                  CMProfileSearchRecordHandle  search,
  1329.                                  CMProfileHandle *        returnProfile,
  1330.                                  long *                    index)                                FOURWORDINLINE(0x203C, 0x0014, 0x0012, 0xABEE);
  1331.  
  1332. EXTERN_API( CMError )
  1333. DeleteDeviceProfile                (OSType                 deviceType,
  1334.                                  long                     refNum,
  1335.                                  CMProfileHandle         deleteMe)                            FOURWORDINLINE(0x203C, 0x000C, 0x0013, 0xABEE);
  1336.  
  1337.  
  1338. #if OLDROUTINENAMES
  1339. /* constants */
  1340.  
  1341. typedef CMFlattenProcPtr                 CMFlattenProc;
  1342. typedef CMBitmapCallBackProcPtr         CMBitmapCallBackProc;
  1343. typedef CMProfileFilterProcPtr             CMProfileFilterProc;
  1344.  
  1345. enum {
  1346.     CMTrap                        = cmTrap,
  1347.     CMBeginProfile                = cmBeginProfile,
  1348.     CMEndProfile                = cmEndProfile,
  1349.     CMEnableMatching            = cmEnableMatching,
  1350.     CMDisableMatching            = cmDisableMatching
  1351. };
  1352.  
  1353. /* 1.0 Error codes, for compatibility with older applications. 1.0 CMM's may return obsolete error codes */
  1354.  
  1355. enum {
  1356.     CMNoError                    = 0,                            /*    obsolete name, use noErr */
  1357.     CMProfileError                = cmProfileError,
  1358.     CMMethodError                = cmMethodError,
  1359.     CMMemFullError                = -172,                            /*    obsolete, 2.0 uses memFullErr */
  1360.     CMUnimplementedError        = -173,                            /*    obsolete, 2.0 uses unimpErr */
  1361.     CMParamError                = -174,                            /*    obsolete, 2.0 uses paramErr */
  1362.     CMMethodNotFound            = cmMethodNotFound,
  1363.     CMProfileNotFound            = cmProfileNotFound,
  1364.     CMProfilesIdentical            = cmProfilesIdentical,
  1365.     CMCantConcatenateError        = cmCantConcatenateError,
  1366.     CMCantXYZ                    = cmCantXYZ,
  1367.     CMCantDeleteProfile            = cmCantDeleteProfile,
  1368.     CMUnsupportedDataType        = cmUnsupportedDataType,
  1369.     CMNoCurrentProfile            = cmNoCurrentProfile
  1370. };
  1371.  
  1372.  
  1373. enum {
  1374.     qdSystemDevice                = cmSystemDevice,
  1375.     qdGDevice                    = cmGDevice
  1376. };
  1377.  
  1378.  
  1379. enum {
  1380.     kMatchCMMType                = cmMatchCMMType,
  1381.     kMatchApplProfileVersion    = cmMatchApplProfileVersion,
  1382.     kMatchDataType                = cmMatchDataType,
  1383.     kMatchDeviceType            = cmMatchDeviceType,
  1384.     kMatchDeviceManufacturer    = cmMatchDeviceManufacturer,
  1385.     kMatchDeviceModel            = cmMatchDeviceModel,
  1386.     kMatchDeviceAttributes        = cmMatchDeviceAttributes,
  1387.     kMatchFlags                    = cmMatchFlags,
  1388.     kMatchOptions                = cmMatchOptions,
  1389.     kMatchWhite                    = cmMatchWhite,
  1390.     kMatchBlack                    = cmMatchBlack
  1391. };
  1392.  
  1393. /* types */
  1394. typedef CMCMYKColor                     CMYKColor;
  1395. typedef CMWorldRef                         CWorld;
  1396. typedef long *                            CMGamutResult;
  1397. /* functions */
  1398. #define EndMatching(myRef)                                                        CMEndMatching(myRef)
  1399. #define EnableMatching(enableIt)                                                CMEnableMatchingComment(enableIt)
  1400. #define GetColorSyncFolderSpec(vRefNum, createFolder, foundVRefNum, foundDirID)    CMGetColorSyncFolderSpec(vRefNum, createFolder, foundVRefNum, foundDirID)
  1401. #define BeginMatching(src, dst, myRef)                                            CMBeginMatching(src, dst, myRef)
  1402. #define DrawMatchedPicture(myPicture, dst, myRect)                                CMDrawMatchedPicture(myPicture, dst, myRect)
  1403. #define UseProfile(profile)                                                        CMUseProfileComment(profile)
  1404. #define GetProfileName(myProfile, IStringResult)                                CMGetProfileName(myProfile, IStringResult)
  1405. #define GetProfileAdditionalDataOffset(myProfile)                                CMGetProfileAdditionalDataOffset(myProfile)
  1406. #endif  /* OLDROUTINENAMES */
  1407.  
  1408.  
  1409. /* Deprecated stuff*/
  1410.  
  1411. /* PrGeneral parameter blocks */
  1412.  
  1413. struct TEnableColorMatchingBlk {
  1414.     short                             iOpCode;
  1415.     short                             iError;
  1416.     long                             lReserved;
  1417.     THPrint                         hPrint;
  1418.     Boolean                         fEnableIt;
  1419.     SInt8                             filler;
  1420. };
  1421. typedef struct TEnableColorMatchingBlk    TEnableColorMatchingBlk;
  1422.  
  1423. struct TRegisterProfileBlk {
  1424.     short                             iOpCode;
  1425.     short                             iError;
  1426.     long                             lReserved;
  1427.     THPrint                         hPrint;
  1428.     Boolean                         fRegisterIt;
  1429.     SInt8                             filler;
  1430. };
  1431. typedef struct TRegisterProfileBlk        TRegisterProfileBlk;
  1432. #endif  /* TARGET_OS_MAC */
  1433.  
  1434.  
  1435. #if PRAGMA_STRUCT_ALIGN
  1436.     #pragma options align=reset
  1437. #elif PRAGMA_STRUCT_PACKPUSH
  1438.     #pragma pack(pop)
  1439. #elif PRAGMA_STRUCT_PACK
  1440.     #pragma pack()
  1441. #endif
  1442.  
  1443. #ifdef PRAGMA_IMPORT_OFF
  1444. #pragma import off
  1445. #elif PRAGMA_IMPORT
  1446. #pragma import reset
  1447. #endif
  1448.  
  1449. #ifdef __cplusplus
  1450. }
  1451. #endif
  1452.  
  1453. #endif /* __CMAPPLICATION__ */
  1454.  
  1455.